package com.atguigu.tingshu.common.util;

/**
 * 获取当前用户信息帮助类
 */
public class AuthContextHolder {

    private static ThreadLocal<Long> userId = new ThreadLocal<Long>();

    private static ThreadLocal<Integer> isVip = new ThreadLocal<Integer>();

    private static ThreadLocal<Long> vipExpireTime = new ThreadLocal<Long>();

    public static Integer getIsVip() {
        return isVip.get();
    }

    public static void setIsVip(Integer _isVip) {
        isVip.set(_isVip);
    }

    public static void removeIsVip() {
        isVip.remove();
    }

    public static Long getVipExpireTime() {
        return vipExpireTime.get();
    }

    public static void setVipExpireTime(Long _expireTime) {
        vipExpireTime.set(_expireTime);
    }

    public static void removeVipExpireTime() {
        vipExpireTime.remove();
    }

    public static Long getUserId() {
        return userId.get();
    }

    public static void setUserId(Long _userId) {
        userId.set(_userId);
    }

    public static void removeUserId() {
        userId.remove();
    }

}
